<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateActivePricesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('active_prices', function (Blueprint $table) {
            $table->id();
            $table->tinyInteger('type')->default(1)->comment('1春节价格');
            $table->float('rate',10,2)->default(0.00)->comment('折扣');
            $table->float('additional',10,2)->default(1)->comment('折上折');
            $table->integer('days')->default(0)->comment('天数');

            $table->timestamps();
        });
        \DB::statement("ALTER TABLE `active_prices` comment '活动价格折扣'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('active_prices');
    }
}
